<?php

class m131116_071910_oak extends CDbMigration
{
    public function safeUp()
    {
        $sql = 'CREATE TABLE `{{user_mapping}}`
                (
                    `id` bigint PRIMARY KEY,
                    `search_purpose_id` tinyint,
                    `gender_id` tinyint,
                    `year_of_birth` smallint,
                    `city_id` smallint,
                    `distance` smallint,
                    `created_at` datetime,
                    `updated_at` datetime,

                    INDEX idx (`search_purpose_id`,`gender_id`,`year_of_birth`,`city_id`,`distance`)
                )
                ENGINE=MEMORY DEFAULT CHARSET=utf8;';

        $this->execute($sql);
    }

    public function safeDown()
    {
        return false;
    }
}